home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Tele / C / Comet2.1.3.cpt / include / emdefs.h < prev    next >
Text File  |  1991-06-26  |  4KB  |  146 lines

  1. /*
  2.     Copyright Cornell University 1986.  All rights are reserved.
  3.  
  4. */
  5.  
  6. /*
  7.  * emdefs.h--contains defines used by em routines 
  8.  */
  9.  
  10.  
  11. #define TRUE    (-1)
  12. #define FALSE    0
  13.  
  14. #ifndef NULL
  15. #define NULL    0L
  16. #endif
  17.  
  18. #define MAXWIND        50            /* size of the window array */ 
  19.  
  20. /* window classes */
  21. #define EMWINDKIND        9        /* an emulator window */ 
  22. #define ICONWINDKIND    10        /* an icon window */ 
  23. #define TEXTWINDKIND    11        /* a text window */ 
  24. #define HELPWINDKIND    11        /* the help window */ 
  25.  
  26. /* connection classes */
  27. #define CONN_CUTCP        0        /* the default */
  28. #define CONN_MACTCP        1
  29. #define CONN_COMMMGR    2
  30. #define CONN_SERD        3
  31.  
  32. /* terminal types */
  33. #define TERM_VT100        0
  34. #define TERM_3270        1
  35. #define TERM_H19        2
  36. #define TERM_VT102        3
  37. #define TERMTYPECOUNT    4            /* # of terminal types implemented */
  38. #define TERMTYPEMAX        12            /* # of possible types */
  39.  
  40. #define TERM_VT220        4            /* unused */
  41.  
  42. /* program states to which h19 "mode" is set */
  43. #define NORMMODE    0        /* we are receiving characters to be put on the screen */ 
  44. #define ESCMODE        1        /* escape encountered, interpret command */
  45. #define SETMODES    2        /* set various modes--highlighting etc */
  46. #define RESETMODES    3        /* reset */
  47. #define YCALC        4        /* next byte has Y coordinate */
  48. #define XCALC        5        /* next byte has X coordinate */
  49. #define CFTMODE        6        /* file transfer initiate negotiations */
  50. #define CFT2MODE    7        /* in negotiations */
  51. #define C19FTMODE    8        /* in file transfer mode */
  52. #define VT100MODE    9        /* act as a vt100 when doing scrolling routines */
  53.  
  54. /* new mode : for vt100 */
  55. #define    VT_ESC        1        /* last char was an escape */
  56. #define    VT_ANSI        2        /* " bracket */
  57. #define    VT_POUND    3        /* # was seen */
  58. #define    VT_LPAREN    4        /* ( was seen, select alt char set */
  59. #define    VT_RPAREN    5        /* ) was seen, revert char set ? */
  60. /* skip CFTMODE, CFT2MODE, C19FTMODE */
  61. #define    VT_QMARK    9        /* ? was seen, interpret "DEC private" modes */
  62. #define    VT_VT52        10        /* DEC private vt52 mode */
  63. #define    VT_SPACE    11        /* ' ' was seen... DEC VT200 commands */
  64.  
  65. /* screen logic */
  66. #define TOPROW        0
  67. #define LASTROW        23
  68. #define LASTCOL        79
  69. #define TABSIZE        8
  70.  
  71. #define LINELENGTH        (LASTCOL + 1)    
  72. #define MAXLINELENGTH    LINELENGTH
  73. #define SCREENSIZE        ((LASTROW + 1) * LINELENGTH)
  74. #define SIZE23            LASTROW * LINELENGTH
  75.  
  76. /* screen attributes */
  77. #define BOLD        0x01
  78. #define REVERSE        0x02
  79. #define UNDERSCORE    0x04
  80. #define BLINK        0x08
  81.  
  82. #define NORMFONT    0                    /* vt100 normal */
  83. #define VTFONT        0x80                /* vt100 graphics font */
  84.  
  85. /* screen attribute masks */
  86. #define NOATTR        0xC0                /* for anding out... */
  87. #define VTATTR        0x3F                /* bottom six bits for attributes */
  88.  
  89. /* lower level screen constants */
  90. #define LINEHEIGHT    12                    /* the fully-leaded font height */
  91. #define FONTHEIGHT    11                    /* total pixels in font */
  92. #define FONTSIZE    9                    /* # ascending pixels */
  93. #define FONTDESCENT    2                    /* # descending pixels */
  94. #define FONTWIDTH    6                    /* width in pixels */
  95.  
  96. #define TOPMARG        0                    /* we use a 0 based coordinate system */
  97. #define LEFTMARG    0
  98. #define BOTTOMMARG    288                    /* bottom pixel, height in pixels of screen */
  99. #define RIGHTMARG    480                    /* right hand pixel, width of screen */
  100.  
  101. #define CURSTOP        FONTHEIGHT
  102. #define CURSBOT        1
  103.  
  104. #define MRECTTOP    FONTHEIGHT - 1        
  105. #define MRECTBOT    2
  106.  
  107. #define TOPRMARG    438                /* don't allow top controls past this point */
  108.  
  109. /* defs for screen mapping and redrawing */
  110.  
  111. #define ASCCHARS    128
  112. #define SKIPLINES      49             /* was 52--no. of scan lines to skip at top */
  113. #define NOATTRS        16
  114.  
  115. #define MAXARGS    10                    /* vt100 maximum # of args */
  116.  
  117.  
  118. /* cursor seeking logic */
  119.  
  120. #define CURNORMMODE    0        /* mousing-cursor uses standard escape sequences to communicate with host */
  121. #define CURVIMODE    1        /* mousing-cursor sends UNIX vi codes to move host cursor 40X more economically */
  122. #define CUREMACSMODE    2    /* haven't found means of doing this with emacs */
  123.  
  124. /* mask for clrflg & modflg */
  125. #define SCRALLMOD    0xFFFFFFFF
  126.  
  127. #define MAXCOLORS        16            /* 16 colors possible */
  128.  
  129. #define Q1BUTMAX     24                /* Max # of buttons on button bar */
  130.  
  131. #define    MAX_Q    1000                /* queue size for token interpretation */
  132.  
  133.  
  134.  
  135. typedef struct fonts
  136. {
  137.     unsigned short *font1;
  138.     unsigned short *font2;
  139.     unsigned short *font3;
  140. } FONTS;
  141.  
  142. #define NOCHARS        256                /* number of chars in font */
  143.  
  144.  
  145. #define LINE25LEN    80
  146.